<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      console.log("123", parseInt("123")); //123
      console.log(" 123 ", parseInt(" 123 ")); //123
      console.log("123abc", parseInt("123abc")); //123
      console.log(" 12 3abc", parseInt(" 12 3abc")); //12
      console.log("abc123", parseInt("abc123")); //NaN
      console.log("12.3", parseFloat("12.3")); //12.3
      console.log(" 12.3 ", parseFloat(" 12.3 ")); //12.3
      console.log(" 12.3.456 ", parseFloat(" 12.3.456")); //12.3
      console.log("abc 12.3.456 ", parseFloat("abc 12.3.456 ")); //NaN
    </script>
  </body>
</html>
